# -*- coding:utf-8 -*-
# Copyright 2022 The Chinaunicom Software Team. All rights reserved.
# @Author : dengyu
# @Time   : 2022/8/15

##################################################################################################
##                      配置文件     Configuration of services parameters                       ##                                                                         ##
##################################################################################################

import os
import warnings
warnings.filterwarnings("ignore")

gen_path = os.getcwd()

config = dict(
    f_dim=768,  # 向量维度
    n_sims=3,  # 召回个数
    search_k=-1,  # 搜索因子

    pro_id=dict(
        # 沃灵通
        faq_0013=dict(
            ann_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/沃灵通_qa.ann',
            source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/沃灵通_qa_data.csv',
            npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/沃灵通_qa_vecs.npy',
            confidence=0.0,
        ),
        # 数据中台
        faq_t8=dict(
            ann_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/数据中台_qa.ann',
            source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/数据中台_qa_data.csv',
            npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/数据中台_qa_vecs.npy',
            confidence=0.0,
        ),
        # faq_template
        faq_t9=dict(
            ann_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/faq_temp.ann',
            source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/faq_temp_data.csv',
            npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/faq_temp_vecs.npy',
            confidence=0.0,
        ),
        # faq standard
        faq_stand=dict(
            ann_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/faq_stand.ann',
            source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/faq_stand_data.csv',
            npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/faq_stand_vecs.npy',
            confidence=0.0,
        ),
    ),

    simbert_path=dict(
        maxlen=50,
        config_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/chinese_simbert_L-12_H-768_A-12/bert_config.json',
        checkpoint_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/chinese_simbert_L-12_H-768_A-12/bert_model.ckpt',
        dict_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/chinese_simbert_L-12_H-768_A-12/vocab.txt',
    )
)


# import os
# import warnings
#
# from src.utils_local.fileutil import get_all_files_name, copy_file
#
# warnings.filterwarnings("ignore")
#
# import os
# import sys
#
#
# curPath = os.path.abspath(os.path.dirname(__file__))
# rootPath = os.path.split(curPath)[0]
# rootPath = os.path.split(rootPath)[0]
# rootPath = os.path.split(rootPath)[0]
# rootPath = '/'.join(rootPath.split('\\'))
# # 先引入目录的上级就好
# sys.path.append(rootPath)
#
# #gen_path = os.getcwd()
# print("current project path is {}".format(rootPath))
# gen_path = rootPath
#
# # windows name trans
# # model_path_arr = [gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/',
# #                   gen_path+r'/src/intelligent_interaction/engine/faq_data/data/',
# #                   gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/']
# #
# # for f in model_path_arr:
# #     f_arr = get_all_files_name(f)
# #     for f_ in f_arr:
# #         if f_.find('沃灵通') != -1:
# #             act_str = f_.replace(u'沃灵通', 'wolingtong')
# #             copy_file(f_,act_str)
# #         if f_.find('数据中台') != -1:
# #             act_str = f_.replace(u'数据中台', 'shujuzhongtai')
# #             copy_file(f_,act_str)
#
#
# config = dict(
#     f_dim=768,  # 向量维度
#     n_sims=3,  # 召回个数
#     search_k=-1,  # 搜索因子
#
#     pro_id=dict(
#         # 沃灵通
#         faq_0013=dict(
#             # ann_path= gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/沃灵通_qa.ann',
#             # source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/沃灵通_qa_data.csv',
#             # npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/沃灵通_qa_vecs.npy',
#             ann_path= gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/wolingtong_qa.ann',
#             source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/wolingtong_qa_data.csv',
#             npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/wolingtong_qa_vecs.npy',
#             confidence=0.0,
#         ),
#         # 数据中台
#         faq_01=dict(
#             # ann_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/数据中台_qa.ann',
#             # source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/数据中台_qa_data.csv',
#             # npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/数据中台_qa_vecs.npy',
#             ann_path=gen_path + r'/src/intelligent_interaction/engine/faq_data/annoy_model/shujuzhongtai_qa.ann',
#             source_path=gen_path + r'/src/intelligent_interaction/engine/faq_data/data/shujuzhongtai_qa_data.csv',
#             npy_path=gen_path + r'/src/intelligent_interaction/engine/faq_data/npy_data/shujuzhongtai_qa_vecs.npy',
#             confidence=0.0,
#         ),
#         # faq_template
#         faq_02=dict(
#             ann_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/faq_temp.ann',
#             source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/faq_temp_data.csv',
#             npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/faq_temp_vecs.npy',
#             confidence=0.0,
#         ),
#         # faq standard
#         faq_stand=dict(
#             ann_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/annoy_model/faq_stand.ann',
#             source_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/data/faq_stand_data.csv',
#             npy_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/npy_data/faq_stand_vecs.npy',
#             confidence=0.0,
#         ),
#     ),
#
#     simbert_path=dict(
#         maxlen=50,
#         config_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/chinese_simbert_L-12_H-768_A-12/bert_config.json',
#         checkpoint_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/chinese_simbert_L-12_H-768_A-12/bert_model.ckpt',
#         dict_path=gen_path+r'/src/intelligent_interaction/engine/faq_data/chinese_simbert_L-12_H-768_A-12/vocab.txt',
#     )
# )



